package cn.classg.rabbitmq.annotation;

import org.springframework.amqp.rabbit.annotation.Argument;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 消息队列
 * @author CLASSG
 */
@Target({})
@Retention(RetentionPolicy.RUNTIME)
public @interface MqQueue {

    String TRUE = "true";

    String FALSE = "false";

    /**
     * @return the queue name or "" for a generated queue name (default).
     */
    @AliasFor("name") String value() default "";

    /**
     * @return the queue name or "" for a generated queue name (default).
     * @since 2.0
     */
    @AliasFor("value") String name() default "";

    /**
     * Specifies if this queue should be durable.
     * By default if queue name is provided it is durable.
     *
     * @return true if the queue is to be declared as durable.
     * @see org.springframework.amqp.core.Queue#isDurable()
     */
    String durable() default TRUE;

    /**
     * Specifies if this queue should be exclusive.
     * By default if queue name is provided it is not exclusive.
     *
     * @return true if the queue is to be declared as exclusive.
     * @see org.springframework.amqp.core.Queue#isExclusive()
     */
    String exclusive() default FALSE;

    /**
     * Specifies if this queue should be auto deleted when not used.
     * By default if queue name is provided it is not auto-deleted.
     *
     * @return true if the queue is to be declared as auto-delete.
     * @see org.springframework.amqp.core.Queue#isAutoDelete()
     */
    String autoDelete() default FALSE;

    /**
     * @return the arguments to apply when declaring this queue.
     * @since 1.6
     */
    Argument[] arguments() default {};

    /**
     * queue priority level
     * @return
     */
    int order() default Integer.MIN_VALUE;
}
